﻿#region Using directives

using System;
using System.Data;
using System.Collections;
using System.Data.Common;
using System.Diagnostics;
using Microsoft.Practices.EnterpriseLibrary.Data;
using System.ComponentModel;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
using NetROS.Tiers.Data.Bases;
using NetROS.Tiers.Entities;
using NetROS.Tiers.Data;

#endregion

namespace NetROS.Tiers.Data.SqlClient
{
	///<summary>
	/// This class is the SqlClient Data Access Logic Component implementation for the <see cref="Knjizenje"/> entity.
	///</summary>
	[DataObject]
	[CLSCompliant(true)]
	public partial class SqlKnjizenjeProvider: SqlKnjizenjeProviderBase
	{
		/// <summary>
		/// Creates a new <see cref="SqlKnjizenjeProvider"/> instance.
		/// Uses connection string to connect to datasource.
		/// </summary>
		/// <param name="connectionString">The connection string to the database.</param>
		/// <param name="useStoredProcedure">A boolean value that indicates if we use the stored procedures or embedded queries.</param>
		/// <param name="providerInvariantName">Name of the invariant provider use by the DbProviderFactory.</param>
		public SqlKnjizenjeProvider(string connectionString, bool useStoredProcedure, string providerInvariantName): base(connectionString, useStoredProcedure, providerInvariantName){}
        //public override void PrebaciRacuneUKnjizenje_VratiIDKnjizenja(TransactionManager transactionManager, int start, int pageLength, ref int? ID)
        //{

        //    SqlDatabase database = new SqlDatabase(this._connectionString);
        //    DbCommand commandWrapper = database.GetStoredProcCommand("fin._tblKnjizenje_PrebaciRacuneUKnjizenje_VratiIDKnjizenja");


        //    database.AddParameter(commandWrapper, "@ID", DbType.Int32, 0, ParameterDirection.InputOutput, true, 10, 0, string.Empty, DataRowVersion.Current, @ID);

        //    IDataReader dr = null;
        //    //Provider Data Requesting Command Event
        //    OnDataRequesting(new CommandEventArgs(commandWrapper, "PrebaciRacuneUKnjizenje_VratiIDKnjizenja", (IEntity)null));

        //    if (transactionManager != null)
        //    {
        //        dr = Utility.ExecuteReader(transactionManager, commandWrapper);
        //    }
        //    else
        //    {
        //        dr = Utility.ExecuteReader(database, commandWrapper);
        //    }

        //    //Provider Data Requested Command Event
        //    OnDataRequested(new CommandEventArgs(commandWrapper, "PrebaciRacuneUKnjizenje_VratiIDKnjizenja", (IEntity)null));
        //    if (dr != null) dr.Close();
        //    @ID = Utility.GetParameterValue<System.Int32?>(commandWrapper.Parameters["@ID"]);


        //    return dr;

        //}
	}
}